import 'package:guochaoapp/model/userdealers_entity.dart';

userdealersEntityFromJson(UserdealersEntity data, Map<String, dynamic> json) {
	if (json['success'] != null) {
		data.success = json['success'];
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['data'] != null) {
		data.data = new List<UserdealersData>();
		(json['data'] as List).forEach((v) {
			data.data.add(new UserdealersData().fromJson(v));
		});
	}
	if (json['sign'] != null) {
		data.sign = json['sign'];
	}
	return data;
}

Map<String, dynamic> userdealersEntityToJson(UserdealersEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['success'] = entity.success;
	data['msg'] = entity.msg;
	data['code'] = entity.code;
	if (entity.data != null) {
		data['data'] =  entity.data.map((v) => v.toJson()).toList();
	}
	data['sign'] = entity.sign;
	return data;
}

userdealersDataFromJson(UserdealersData data, Map<String, dynamic> json) {
	if (json['dealerId'] != null) {
		data.dealerId = json['dealerId'] is String
				? int.tryParse(json['dealerId'])
				: json['dealerId'].toInt();
	}
	if (json['location'] != null) {
		data.location = json['location'].toString();
	}
	return data;
}

Map<String, dynamic> userdealersDataToJson(UserdealersData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['dealerId'] = entity.dealerId;
	data['location'] = entity.location;
	return data;
}